from django.http import Http404, HttpResponse
from django.shortcuts import render


# Create your views here.
def index(request):
    return render(request, "singlepage/index.html")


texts = [
    "Accept what was and what is, and you’ll have more positive energy to pursue what will be.",
    "Enrich your life today,. yesterday is history.tomorrow is mystery.",
    "Great works are performed not by strength, but by perseverance.——Samuel Johnson, British writer and critic",
]


def section(request, num):
    if 1 <= num <= 3:
        return HttpResponse(texts[num - 1])
    else:
        raise Http404("No such section.")
